<?php


namespace app\admin\validate;
use think\Validate;

class LinkValidate extends Validate
{
    protected $rule = [
        'id'=>'require',
        'name'=> 'require|unique:link',
        'link_url'=>'require',

    ];
    protected $message = [
        'id'=>'传入的ID为空',
        'name' => '链接名字必须填写',
        'name.unique' => "链接名字不能重复",
        'link_url'=>'连接不能为空',
    ];

    protected $scene = [
        'link_add'=>['name','link_url'],
        'link_edit'=>['name','link_url','id'],
    ];
}